<link href="/public/css/main.css" rel="stylesheet">
<div class="">
    <div class="login_div">
        <form  action='/home/passport/subregister' method="post" id='register_form'>
            <div class='form-group row'>
                <label for="exampleInputName2">真实姓名:</label>
                <input type="text" class="form-control" name='user_name' placeholder="" value=""/>
            </div>
            <div class='form-group row'>
                <label for="exampleInputName2">账号(手机号):</label>
                <input type="text" class="form-control" name='account' placeholder="手机号" value=""/>
            </div>
            <div class='form-group row'>
                <label for="exampleInputName2">密码:</label>
                <input type="password" class="form-control" id="password" name='password' placeholder="6-12位密码" value=""/>
            </div>
            <div class='form-group row'>
                <label for="exampleInputName2">确认密码:</label>
                <input type="password" class="form-control" name='repassword' placeholder="6-12位密码" value=""/>
            </div>
            <div class="form-group login_sub">
                <input type="submit" class="btn btn-info" name="submit" value="提交">
            </div>
        </form>
    </div>
</div>
<script type='text/javascript'>
    $(document).ready(function () {
        $("#register_form").validate({
            rules: {
                user_name: {
                    required: true,
                    rangelength: [1, 10]
                },
                account: {
                    required: true,
                    number: true,
                    mobile: true
                },
                password: {
                    required: true,
                    rangelength: [6, 12]
                },
                repassword: {
                    required: true,
                    rangelength: [6, 12],
                    equalTo: "#password"
                }
            },
            messages: {
                user_name: {
                    required: '请输入姓名',
                    rangelength: '请输入最多5个中文字符',
                },
                account: {
                    required: '请输入手机号',
                    number: '请输入手机号',
                    mobile: '请输入手机号'
                },
                password: {
                    required: '请输入密码：6-12位',
                    rangelength: '请输入密码：6-12位'
                },
                repassword: {
                    required: '请输入密码：6-12位',
                    rangelength: '请输入密码：6-12位',
                    equalTo: '两次密码不一致'
                },
            }
        });
        jQuery.validator.addMethod("mobile", function (value, element) {
            var length = value.length;
            var mobile = /^(((1[1-9]{1}[0-9]{1})|(15[0-9]{1}))+\d{8})$/
            return this.optional(element) || (length == 11 && mobile.test(value));
        }, "手机号码格式错误");
    });
</script>